package io.gitee.wminyu.day02;

import org.junit.Test;

import java.util.Arrays;

public class Bubble {
  public static void main(String[] args) {
    int a[]={1,2,8,-5,10};
    for (int i=0; i<5-1; i++){
      for (int j=0; j<5-i-1;j++){
        int temp;
        if (a[j]>a[j+1]){
          temp=a[j];
          a[j]=a[j+1];
          a[j+1]=temp;
        }
      }System.out.print(a[i]+" ");
    }
      System.out.println();
      System.out.println(Arrays.toString(a));

  }




}
